Ext.define('AmpleHarvest.views.geSearch.main',
{
	extend			: 'Ext.panel.Panel',
	alias			: 'widget.ampleharvest-views-gesearch-main',
	title			: 'New GROUNDEFFECT Search',
	requires		:
	[
	 		"AmpleHarvest.objects.results.results",
	 		"AmpleHarvest.views.geSearch.searchBox"
	],
	anchor			: '100% 100%',
	layout			: 'border',
	listeners		:
	{
		openItem : function(model, record, index)
		{
			m_obj_AmpleHarvest_ViewPort.fireEvent( AmpleHarvest.eventHandler.cWindowEvents.C_STR_EVENT_GE_TPDS_OPEN, record.get('id') );
		}
	},
	
	initComponent	: function()
	{
		this.m_obj_searchBox = Ext.create(
				"AmpleHarvest.views.geSearch.searchBox",
				{
					region	: "north"
				}
		);
		var test = 'управление';

		this.m_obj_results = Ext.create(
				"AmpleHarvest.objects.results.results",
				{
					region	: 'center',
					flex	: 3,
					maxLimit: 15,
					store	: Ext.create('AmpleHarvest.DATA.Store.geSolr',
			    			{
				    			AHcaller	: this
			    			}),
					columns: [
			               {  header      : 'Title', dataIndex   : 'title', flex: 1.5, sortable : true,
			                  renderer: function(value, metaData, record) { return "<b>"+value+"</b>" } },
			                  
			               {  header      : 'Source',    dataIndex   : 'source', width: 50, sortable : true},
			               {  header      : 'Classification',    dataIndex   : 'classification', width: 100, sortable : true},
			               {  header      : 'Publish Date',    dataIndex   : 'publishDate', width: 125, sortable : true,
			                  renderer: function(value, metaData, record) { return value } },
			               {  header      : 'Language',    dataIndex   : 'language',width: 100, sortable : true},
			               {  header      : 'Summary',    dataIndex   : 'summary', flex:1, sortable : false}
			         ],
				}
		);


		this.items =
		[
				this.m_obj_searchBox,
				this.m_obj_results
		]
		this.callParent();

	}
});


